package com.example.heipictureserver.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.heipictureserver.modal.domain.Space;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.heipictureserver.modal.domain.User;
import com.example.heipictureserver.modal.dto.space.SpaceAddRequest;
import com.example.heipictureserver.modal.dto.space.SpaceQueryRequest;
import com.example.heipictureserver.modal.vo.SpaceVO;

import javax.management.Query;
import javax.servlet.http.HttpServletRequest;

/**
* @author bwg
* @description 针对表【space(空间)】的数据库操作Service
* @createDate 2025-01-31 14:45:43
*/
public interface SpaceService extends IService<Space> {

    String addSpace(SpaceAddRequest spaceAddRequest, User loginUser);

    void validSpace(Space space, boolean add);

    void fillSpaceBySpaceLevel(Space space);

    /**
     * 验证空间用户权限
     * @param loginUser
     * @param oldSpace
     */
    void checkSpaceAuth(User loginUser, Space oldSpace);

    QueryWrapper<Space> getQueryWrapper(SpaceQueryRequest spaceQueryRequest);

    /**
     * 获取空间VO
     * @param space
     * @param request
     * @return
     */
    SpaceVO getSpaceVO(Space space, HttpServletRequest request);

    /**
     * 分页获取空间列表（封装类）
     * @param spacePage
     * @param request
     * @return
     */
    Page<SpaceVO> getSpaceVOPage(Page<Space> spacePage, HttpServletRequest request);
}
